﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:CncConvProg_View_Controls="clr-namespace:CncConvProg.View.Controls">
    <Style TargetType="Button">
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value=".5" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="ImageStyle">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=GruppoMateriale}" Value="0">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_p.png"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path= GruppoMateriale}" Value="1">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_m.png"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=GruppoMateriale}" Value="2">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_k.png"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=GruppoMateriale}" Value="3">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_n.png"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=GruppoMateriale}" Value="4">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_h.png"/>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=GruppoMateriale}" Value="5">
                <Setter Property="Image.Source" Value="pack://application:,,,/CncConvProg.View;component/Images/Gui/Material/mat_s.png"/>
            </DataTrigger>

        </Style.Triggers>
    </Style>

    <Style x:Key="TextBlockStyle1Dialog" TargetType="{x:Type TextBlock}">
        <Setter Property="MinWidth" Value="60"/>
    </Style>
    <Style x:Key="TextBoxStyle1Dialog" TargetType="{x:Type TextBox}">
        <Setter Property="MinWidth" Value="60"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsUserInputed}" Value="false">
                <Setter Property="Foreground" Value="LightGray"/>
                <Setter Property="FontStyle" Value="Italic"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="StackPanelStyle1Dialog" TargetType="{x:Type StackPanel}">
        <Setter Property="Margin" Value="2"/>
    </Style>
    <!-- Resource dictionary entries should be defined here. -->
	<Style x:Key="FocusableListBoxItemStyle1" TargetType="{x:Type CncConvProg_View_Controls:FocusableListBoxItem}">
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Padding" Value="2,0,0,0"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type CncConvProg_View_Controls:FocusableListBoxItem}">
					<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
						<ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsSelected" Value="True">
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True"/>
								<Condition Property="Selector.IsSelectionActive" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="HorizontalAlignment" Value="Left"/>
		<Setter Property="Margin" Value="0,8,0,0"/>
	</Style>
</ResourceDictionary>